<!--
 * @Description: 
 * @Author: william
 * @Date: 2025-06-03 09:21:17
 * @LastEditors: william
 * @LastEditTime: 2025-06-13 10:40:30
-->
<template>
  <up-modal
    class="nw-modal"
    :show="visible"
    :title="title"
    :cancelText="$t('public.cancel')"
    :confirmText="$t('public.confirm')"
    showCancelButton
    confirmColor="#6fba2c"
    :asyncClose="false"
    :="$attrs"
    @cancel="modelCancel"
    @confirm="modelConfirm"
  >
    <slot />
  </up-modal>
</template>

<script setup>
defineOptions({
  name: 'Modal',
  inheritAttrs: false
})

const props = defineProps({
  title: {
    type: String,
    default: ''
  }
})
const visible = defineModel({
  type: Boolean,
  default: false
})
const emit = defineEmits(['cancel', 'confirm'])

const modelCancel = _ => {
  visible.value = false
  emit('cancel')
}
const modelConfirm = _ => {
  emit('confirm')
}
</script>

<style lang="scss">
.nw-modal {
  :deep(.u-popup__content) {
    overflow: initial !important;
  }
  :deep(.u-modal) {
    overflow: initial !important;
    .u-modal__title {
      padding: 20rpx 0;
    }
    .u-modal__content {
      padding: 10rpx 20rpx;
      padding-top: 0 !important;
      padding-bottom: 0rpx;
    }
  }
}
</style>
